<?xml version="1.0" encoding="iso-8859-1" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content=
    "application/xhtml+xml; charset=iso-8859-1" />
    <title>
      mdadm-4.1
    </title>
    <link rel="stylesheet" type="text/css" href="../stylesheets/lfs.css" />
    <meta name="generator" content="DocBook XSL Stylesheets V1.79.1" />
    <link rel="stylesheet" href="../stylesheets/lfs-print.css" type=
    "text/css" media="print" />
  </head>
  <body class="blfs" id="blfs-9.1">
    <div class="navheader">
      <h4>
        Beyond Linux<sup>�</sup> From Scratch <span class="phrase">(System
        V</span> Edition) - Version 9.1
      </h4>
      <h3>
        Chapter&nbsp;5.&nbsp;File Systems and Disk Management
      </h3>
      <ul>
        <li class="prev">
          <a accesskey="p" href="raid.html" title="About RAID">Prev</a>
          <p>
            About RAID
          </p>
        </li>
        <li class="next">
          <a accesskey="n" href="ntfs-3g.html" title=
          "ntfs-3g-2017.3.23">Next</a>
          <p>
            ntfs-3g-2017.3.23
          </p>
        </li>
        <li class="up">
          <a accesskey="u" href="filesystems.html" title=
          "Chapter&nbsp;5.&nbsp;File Systems and Disk Management">Up</a>
        </li>
        <li class="home">
          <a accesskey="h" href="../index.html" title=
          "Beyond Linux� From Scratch     (System V Edition) - Version 9.1">Home</a>
        </li>
      </ul>
    </div>
    <div class="sect1" lang="en" xml:lang="en">
      <h1 class="sect1">
        <a id="mdadm" name="mdadm"></a>mdadm-4.1
      </h1>
      <div class="package" lang="en" xml:lang="en">
        <h2 class="sect2">
          Introduction to mdadm
        </h2>
        <p>
          The <span class="application">mdadm</span> package contains
          administration tools for software RAID.
        </p>
        <p>
          This package is known to build and work properly using an LFS-9.1
          platform.
        </p>
        <h3>
          Package Information
        </h3>
        <div class="itemizedlist">
          <ul class="compact">
            <li class="listitem">
              <p>
                Download (HTTP): <a class="ulink" href=
                "https://www.kernel.org/pub/linux/utils/raid/mdadm/mdadm-4.1.tar.xz">
                https://www.kernel.org/pub/linux/utils/raid/mdadm/mdadm-4.1.tar.xz</a>
              </p>
            </li>
            <li class="listitem">
              <p>
                Download MD5 sum: 51bf3651bd73a06c413a2f964f299598
              </p>
            </li>
            <li class="listitem">
              <p>
                Download size: 432 KB
              </p>
            </li>
            <li class="listitem">
              <p>
                Estimated disk space required: 4.9 MB (10 MB with tests)
              </p>
            </li>
            <li class="listitem">
              <p>
                Estimated build time: 0.1 SBU (tests take about an hour, only
                partially processor dependent)
              </p>
            </li>
          </ul>
        </div>
        <h3>
          mdadm Dependencies
        </h3>
        <h4>
          Optional
        </h4>
        <p class="optional">
          A <a class="xref" href="../server/mail.html" title=
          "Chapter&nbsp;21.&nbsp;Mail Server Software">MTA</a>
        </p>
        <p class="usernotes">
          User Notes: <a class="ulink" href=
          "http://wiki.linuxfromscratch.org/blfs/wiki/mdadm">http://wiki.linuxfromscratch.org/blfs/wiki/mdadm</a>
        </p>
        <div class="admon caution">
          <img alt="[Caution]" src="../images/caution.png" />
          <h3>
            Caution
          </h3>
          <p>
            Kernel versions in series 4.1 through 4.4.1 have a broken RAID
            implementation. Use a kernel with version at or above 4.4.2.
          </p>
        </div>
      </div>
      <div class="kernel" lang="en" xml:lang="en">
        <h2 class="sect2">
          <a id="mdadm-kernel" name="mdadm-kernel"></a>Kernel Configuration
        </h2>
        <p>
          Enable the following options in the kernel configuration and
          recompile the kernel, if necessary. Only the RAID types desired are
          required.
        </p>
        <pre class="screen">
<code class="literal">Device Drivers ---&gt;
  [*] Multiple devices driver support (RAID and LVM) ---&gt; [CONFIG_MD]
    &lt;*&gt; RAID support                                      [CONFIG_BLK_DEV_MD]
    [*]   Autodetect RAID arrays during kernel boot       [CONFIG_MD_AUTODETECT]
    &lt;*/M&gt;  Linear (append) mode                           [CONFIG_MD_LINEAR]
    &lt;*/M&gt;  RAID-0 (striping) mode                         [CONFIG_MD_RAID0]
    &lt;*/M&gt;  RAID-1 (mirroring) mode                        [CONFIG_MD_RAID1]
    &lt;*/M&gt;  RAID-10 (mirrored striping) mode               [CONFIG_MD_RAID10]
    &lt;*/M&gt;  RAID-4/RAID-5/RAID-6 mode                      [CONFIG_MD_RAID456]</code>
</pre>
      </div>
      <div class="installation" lang="en" xml:lang="en">
        <h2 class="sect2">
          Installation of mdadm
        </h2>
        <p>
          Fix a build error introduced by gcc-7.1:
        </p>
        <pre class="userinput">
<kbd class="command">sed 's@-Werror@@' -i Makefile</kbd>
</pre>
        <p>
          Build <span class="application">mdadm</span> by running the
          following command:
        </p>
        <pre class="userinput">
<kbd class="command">make</kbd>
</pre>
        <p>
          If you wish to run the tests, ensure that your kernel supports RAID
          and that a version of mdadm is not already running. As many as 9
          out of 124 tests may fail.
        </p>
        <div class="admon caution">
          <img alt="[Caution]" src="../images/caution.png" />
          <h3>
            Caution
          </h3>
          <p>
            The tests edit values in /proc and run tests on software raid
            devices. They shouldn't be run on systems with active software
            RAID devices.
          </p>
        </div>
        <p>
          Run the tests as the <code class="systemitem">root</code> user:
        </p>
        <pre class="root">
<kbd class="command">./test --keep-going --logdir=test-logs --save-logs</kbd>
</pre>
        <p>
          Now, as the <code class="systemitem">root</code> user:
        </p>
        <pre class="root">
<kbd class="command">make install</kbd>
</pre>
      </div>
      <div class="commands" lang="en" xml:lang="en">
        <h2 class="sect2">
          Command Explanations
        </h2>
        <p>
          <span class="command"><strong>make everything</strong></span>: This
          optional target creates extra programs, particularly a
          statically-linked version of <span class=
          "command"><strong>mdadm</strong></span> and also versions of
          <span class="command"><strong>mdassemble</strong></span>. These all
          need to be manually installed.
        </p>
        <p>
          <em class="parameter"><code>--keep-going</code></em>: Run the tests
          to the end, even if one or more tests fail.
        </p>
        <p>
          <em class="parameter"><code>--logdir=test-logs</code></em>: Defines
          the directory where test logs are saved.
        </p>
        <p>
          <em class="parameter"><code>--save-logs</code></em>: Instructs the
          test suite to save the logs.
        </p>
        <p>
          <code class="option">--tests=<em class=
          "replaceable"><code>&lt;test1,test2,...&gt;</code></em></code>:
          Optional comma separated list of tests to be executed (all tests,
          if this option is not passed).
        </p>
      </div>
      <div class="content" lang="en" xml:lang="en">
        <h2 class="sect2">
          Contents
        </h2>
        <div class="segmentedlist">
          <div class="seglistitem">
            <div class="seg">
              <strong class="segtitle">Installed Programs:</strong>
              <span class="segbody">mdadm, mdmon and optionally
              mdassemble</span>
            </div>
            <div class="seg">
              <strong class="segtitle">Installed Libraries:</strong>
              <span class="segbody">None</span>
            </div>
            <div class="seg">
              <strong class="segtitle">Installed Directory:</strong>
              <span class="segbody">None</span>
            </div>
          </div>
        </div>
        <div class="variablelist">
          <h3>
            Short Descriptions
          </h3>
          <table border="0" class="variablelist">
            <colgroup>
              <col align="left" valign="top" />
              <col />
            </colgroup>
            <tbody>
              <tr>
                <td>
                  <p>
                    <a id="mdadm-prog" name="mdadm-prog"></a><span class=
                    "term"><span class=
                    "command"><strong>mdadm</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    manages MD devices aka Linux Software RAID.
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="mdmon" name="mdmon"></a><span class=
                    "term"><span class=
                    "command"><strong>mdmon</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    monitors MD external metadata arrays.
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="mdassemble" name="mdassemble"></a><span class=
                    "term"><span class=
                    "command"><strong>mdassemble</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    is a tiny program that can be used to assemble MD devices
                    inside an initial ramdisk (initrd) or initramfs.
                  </p>
                </td>
              </tr>
            </tbody>
          </table>
        </div>
      </div>
      <p class="updated">
        Last updated on 2020-02-18 14:50:03 -0800
      </p>
    </div>
    <div class="navfooter">
      <ul>
        <li class="prev">
          <a accesskey="p" href="raid.html" title="About RAID">Prev</a>
          <p>
            About RAID
          </p>
        </li>
        <li class="next">
          <a accesskey="n" href="ntfs-3g.html" title=
          "ntfs-3g-2017.3.23">Next</a>
          <p>
            ntfs-3g-2017.3.23
          </p>
        </li>
        <li class="up">
          <a accesskey="u" href="filesystems.html" title=
          "Chapter&nbsp;5.&nbsp;File Systems and Disk Management">Up</a>
        </li>
        <li class="home">
          <a accesskey="h" href="../index.html" title=
          "Beyond Linux� From Scratch     (System V Edition) - Version 9.1">Home</a>
        </li>
      </ul>
    </div>
  </body>
</html>
